<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class company_model extends MY_Model {

	protected $table		= "company";
	protected $key			= "id";
	protected $soft_deletes	= true;
	protected $date_format	= "datetime";
	protected $set_created	= true;
	protected $set_modified = true;

	//---------------------------------------------------------------
	
	/*
		Method: find_count()
		
		Returns the count number of contacts for a given company. 
		
		Return:
			An number of all contacts (not deleted), or false.
	*/
	function find_count($com_id)
	{
		$this->db->where('company', $com_id);
		$this->db->where('deleted', 0);
		$this->db->from('contacts');
		$query = $this->db->count_all_results();
		
		if ($query)
		{
			return $query;
		}
		
		return false;
	}
	

}
